package cn.tedu.mintmall.service.Impl;

import cn.tedu.mintmall.dto.UserAdminDTO;
import cn.tedu.mintmall.entity.User;
import cn.tedu.mintmall.mapper.UserAdminMapper;
import cn.tedu.mintmall.service.IUserAdminService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

@Service
@Slf4j
public class UserAdminImpl implements IUserAdminService {
    @Autowired
    private UserAdminMapper mapper;
    @Override
    public void updateUserDetail(UserAdminDTO userAdminDTO) {
        User user=new User();
        BeanUtils.copyProperties(userAdminDTO,user);
        user.setGmtModified(LocalDateTime.now());
        mapper.updateUser(user);
    }
}
